<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>

    <button type="button" onclick="judgeStudentAchievement()">判断学生成绩</button>
    <script>

        function judgeStudentAchievement() {
            const score = Number(prompt("请输入成绩。"));
            let grade;

            if (score >= 0 && score < 60) {
                grade = "不及格"
            } else if (score >= 60 && score < 70) {
                grade = "及格"
            } else if (score >= 70 && score < 80) {
                grade = "良好"
            } else if (score >= 80 && score <= 100) {
                grade = "优秀"
            } else {
                alert("分数输入错误，请重新输入")
                return
            }
            alert(grade)
        }
    </script>

</body>

</html>